package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 提现用户类型(1-商户本金，2-经纪人，3-商户补贴)
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum WithdrawalConfigUserTypeEnum {

    MERCHANT_AMT(1, "商户本金"),
    AGENT_COMMISSION(2, "经纪人"),
    MERCHANT_SUBSIDY(3, "商户补贴"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    WithdrawalConfigUserTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static WithdrawalConfigUserTypeEnum typeOf(Integer value) {
        WithdrawalConfigUserTypeEnum[] values = WithdrawalConfigUserTypeEnum.values();
        for (WithdrawalConfigUserTypeEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static WithdrawalConfigUserTypeEnum typeOf(String name) {
        WithdrawalConfigUserTypeEnum[] values = WithdrawalConfigUserTypeEnum.values();
        for (WithdrawalConfigUserTypeEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
